package com.efast.dmom.mgmt.controller.mes.qm;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.efast.cafe.framework.bean.ResultBean;
import com.efast.dmom.mgmt.bean.mes.qm.RepairConsumptionSaveBean;
import com.efast.dmom.mgmt.service.mes.qm.impl.DefectRepairService;

@Controller
@RequestMapping("/qm")
public class DefectRepairController {
	
	@Autowired
	DefectRepairService repairService;

	@RequestMapping(value = "/repair/getConsumptionListByVin/{vin}/{part}")
	public @ResponseBody ResultBean getConsumptionListByVin(@PathVariable("vin") String vin, @PathVariable("part") String part) {

		ResultBean result = repairService.getConsumptionListByVin(vin,part);

		return result;
	}
	
	@RequestMapping(value = "/repairDefect/{id}")
	public @ResponseBody ResultBean closeRepairDefect(@PathVariable Integer id) {
		ResultBean result = new ResultBean(true, null);
		repairService.closeRepairDefect(id);
		result.setSuccess(true);
		return result;
	}
}
